package cn.micro.system.manage.controller;


import cn.micro.system.manage.common.result.Result;
import cn.micro.system.manage.entity.SysOdsLoginRecord;
import cn.micro.system.manage.entity.vo.SysLoginRecordQueryVo;
import cn.micro.system.manage.service.SysOdsLoginRecordService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 * 访问系统记录 前端控制器
 * </p>
 *
 * @author wr
 * @since 2023-12-25
 */
@RestController
@RequestMapping("/manage/sysOdsLoginRecord")
public class SysOdsLoginRecordController {

    @Resource
    private SysOdsLoginRecordService sysOdsLoginRecordService;

    //条件分页查询登录日志
    @ApiOperation(value = "获取分页列表")
    @GetMapping("{page}/{size}")
    @PreAuthorize("hasAuthority('bnt.sysLoginLog.list')")
    public Result list(@PathVariable int page,
                        @PathVariable int size,
                        SysLoginRecordQueryVo sysLoginRecordQueryVo) {
        return Result.success(new PageInfo<>(sysOdsLoginRecordService.selectPage(page,size,sysLoginRecordQueryVo)));
    }
}
